package com.tensquare.friend.config;

import com.tensquare.friend.intercepter.JwtInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author zzb
 * @version 1.0
 * @create 2020/12/24 9:57
 */
@Configuration
public class JwtIntercepter implements WebMvcConfigurer {
    @Autowired
    private JwtInterceptor jwtInterceptor;
    //添加拦截器
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
       registry.addInterceptor(jwtInterceptor).addPathPatterns("/**").excludePathPatterns("/**/login");
    }
}
